package collection;

import java.awt.*;
import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo4 {
    public static void main(String[] args) {
        Collection c = new ArrayList();
//        c.add(123);//c.add(Integer.value(123));

        Point p = new Point(1, 2);
        c.add(p);//将p变量的值(地址)存入集合c中
        System.out.println("p:" + p);
        System.out.println("c:" + c);

        //int x = p.getX(2);
        System.out.println("p:" + p);
        System.out.println("c:" + c);

    }
}
